package com.ruoyi.study.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.study.mapper.UserStudyDetailMapper;
import com.ruoyi.study.domain.UserStudyDetail;
import com.ruoyi.study.service.IUserStudyDetailService;

/**
 * 学习记录明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-05
 */
@Service
public class UserStudyDetailServiceImpl implements IUserStudyDetailService 
{
    @Autowired
    private UserStudyDetailMapper userStudyDetailMapper;

    /**
     * 查询学习记录明细
     * 
     * @param id 学习记录明细ID
     * @return 学习记录明细
     */
    @Override
    public UserStudyDetail selectUserStudyDetailById(Long id)
    {
        return userStudyDetailMapper.selectUserStudyDetailById(id);
    }

    /**
     * 查询学习记录明细列表
     * 
     * @param userStudyDetail 学习记录明细
     * @return 学习记录明细
     */
    @Override
    public List<UserStudyDetail> selectUserStudyDetailList(UserStudyDetail userStudyDetail)
    {
        return userStudyDetailMapper.selectUserStudyDetailList(userStudyDetail);
    }

    /**
     * 新增学习记录明细
     * 
     * @param userStudyDetail 学习记录明细
     * @return 结果
     */
    @Override
    public int insertUserStudyDetail(UserStudyDetail userStudyDetail)
    {
        userStudyDetail.setCreateTime(DateUtils.getNowDate());
        return userStudyDetailMapper.insertUserStudyDetail(userStudyDetail);
    }

    /**
     * 修改学习记录明细
     * 
     * @param userStudyDetail 学习记录明细
     * @return 结果
     */
    @Override
    public int updateUserStudyDetail(UserStudyDetail userStudyDetail)
    {
        userStudyDetail.setUpdateTime(DateUtils.getNowDate());
        return userStudyDetailMapper.updateUserStudyDetail(userStudyDetail);
    }

    /**
     * 批量删除学习记录明细
     * 
     * @param ids 需要删除的学习记录明细ID
     * @return 结果
     */
    @Override
    public int deleteUserStudyDetailByIds(Long[] ids)
    {
        return userStudyDetailMapper.deleteUserStudyDetailByIds(ids);
    }

    /**
     * 删除学习记录明细信息
     * 
     * @param id 学习记录明细ID
     * @return 结果
     */
    @Override
    public int deleteUserStudyDetailById(Long id)
    {
        return userStudyDetailMapper.deleteUserStudyDetailById(id);
    }
}
